}));
this.actor.add_actor(this._arrow);
- let stage = Shell.Global.get().stage;
-
// Chain our visibility and lifecycle to that of the source
source.actor.connect('notify::mapped', Lang.bind(this, function () {
if (!source.actor.mapped)
}));
source.actor.connect('destroy', Lang.bind(this, function () { this.actor.destroy(); }));
- stage.add_actor(this.actor);
+ global.stage.add_actor(this.actor);
},
_getPreferredWidth: function(actor, forHeight, alloc) {
}
}
- let activeWorkspace = Shell.Global.get().screen.get_active_workspace();
+ let activeWorkspace = global.screen.get_active_workspace();
let currentWorkspaceWindows = windows.filter(function (w) {
return w.get_workspace() == activeWorkspace;
text: appInfo.get_name() });
nameBox.add_actor(this._name);
this._glowBox = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL });
- let glowPath = GLib.filename_to_uri(Shell.Global.get().imagedir + 'app-well-glow.png', '');
+ let glowPath = GLib.filename_to_uri(global.imagedir + 'app-well-glow.png', '');
for (let i = 0; i < this._windows.length && i < 3; i++) {
let glow = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
glowPath, -1, -1);
_resetTimeDisplay: function(currentSecs) {
let lastSecs = this._docInfo.timestamp;
let timeDelta = currentSecs - lastSecs;
- let [text, nextUpdate] = Shell.Global.get().format_time_relative_pretty(timeDelta);
+ let [text, nextUpdate] = global.format_time_relative_pretty(timeDelta);
this._timeoutTime = currentSecs + nextUpdate;
this._setDescriptionText(text);
}
"const Tweener = imports.ui.tweener; " +
/* Utility functions...we should probably be able to use these
* in the shell core code too. */
- "const global = Shell.Global.get(); " +
"const stage = global.stage; " +
"const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; " +
/* Special lookingGlass functions */
},
_resizeTo: function(actor) {
- let stage = Shell.Global.get().stage;
- let stageWidth = stage.width;
+ let stage = global.stage;
let myWidth = stage.width * 0.7;
let myHeight = stage.height * 0.7;
let [srcX, srcY] = actor.get_transformed_position();
AppPanelMenu.prototype = {
_init: function() {
- this._metaDisplay = Shell.Global.get().screen.get_display();
+ this._metaDisplay = global.screen.get_display();
this._focusedApp = null;
this._activeSequence = null;
const SIDEBAR_COLLAPSED_WIDTH = Widget.COLLAPSED_WIDTH + 3 * WidgetBox.WIDGETBOX_PADDING + SIDEBAR_PADDING;
const SIDEBAR_EXPANDED_WIDTH = Widget.EXPANDED_WIDTH + 3 * WidgetBox.WIDGETBOX_PADDING + SIDEBAR_PADDING;
-// The maximum height of the sidebar would be extending from just
-// below the panel to just above the taskbar. Since the taskbar is
-// just a temporary hack and it would be too hard to do this the right
-// way, we just hardcode its size.
-const HARDCODED_TASKBAR_HEIGHT = 24;
-const MAXIMUM_SIDEBAR_HEIGHT = Shell.Global.get().screen_height - Panel.PANEL_HEIGHT - HARDCODED_TASKBAR_HEIGHT;
-
function Sidebar() {
this._init();
}
const Clutter = imports.gi.Clutter;
const Mainloop = imports.mainloop;
const Meta = imports.gi.Meta;
-const Shell = imports.gi.Shell;
const AltTab = imports.ui.altTab;
const Main = imports.ui.main;
_init : function() {
let me = this;
- this._global = Shell.Global.get();
- this._shellwm = this._global.window_manager;
+ this._shellwm = global.window_manager;
this._minimizing = [];
this._maximizing = [];
this._unmaximizing = [];
if (direction == Meta.MotionDirection.UP ||
direction == Meta.MotionDirection.UP_LEFT ||
direction == Meta.MotionDirection.UP_RIGHT)
- yDest = this._global.screen_height;
+ yDest = global.screen_height;
else if (direction == Meta.MotionDirection.DOWN ||
direction == Meta.MotionDirection.DOWN_LEFT ||
direction == Meta.MotionDirection.DOWN_RIGHT)
- yDest = -this._global.screen_height;
+ yDest = -global.screen_height;
if (direction == Meta.MotionDirection.LEFT ||
direction == Meta.MotionDirection.UP_LEFT ||
direction == Meta.MotionDirection.DOWN_LEFT)
- xDest = this._global.screen_width;
+ xDest = global.screen_width;
else if (direction == Meta.MotionDirection.RIGHT ||
direction == Meta.MotionDirection.UP_RIGHT ||
direction == Meta.MotionDirection.DOWN_RIGHT)
- xDest = -this._global.screen_width;
+ xDest = -global.screen_width;
let switchData = {};
this._switchData = switchData;
switchData.outGroup = new Clutter.Group();
switchData.windows = [];
- let wgroup = this._global.window_group;
+ let wgroup = global.window_group;
wgroup.add_actor(switchData.inGroup);
wgroup.add_actor(switchData.outGroup);
}
}
activeWorkspace.actor.raise_top();
- this._positionWorkspaces(global);
+ this._positionWorkspaces();
let lastWorkspace = this._workspaces[this._workspaces.length - 1];
lastWorkspace.updateRemovable(true);
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
let activeWorkspace = this._workspaces[activeWorkspaceIndex];
- this._positionWorkspaces(global);
+ this._positionWorkspaces();
activeWorkspace.actor.raise_top();
for (let w = 0; w < this._workspaces.length; w++)
// first row.)
//
// FIXME: need to make the metacity internal layout agree with this!
- _positionWorkspaces : function(global) {
+ _positionWorkspaces : function() {
let gridWidth = Math.ceil(Math.sqrt(this._workspaces.length));
let gridHeight = Math.ceil(this._workspaces.length / gridWidth);
newLastWorkspace.updateRemovable();
// Figure out the new layout
- this._positionWorkspaces(global);
+ this._positionWorkspaces();
let newScale = this._workspaces[0].scale;
let newGridWidth = Math.ceil(Math.sqrt(newNumWorkspaces));
let newGridHeight = Math.ceil(newNumWorkspaces / newGridWidth);